var config = require('../../config.js');
var loadSearch = require('loadSearch.js');
var dateutil = require('dateutil.js');
Page({
  data: {
    date: '',
    list:[],
    //date1: '2016-09-03'
  }, onLoad: function (options) {
     this.setData({
       date: dateutil.formatDay(new Date())
     })
     loadSearch.search_time(dateutil.formatDay(new Date()), this,true);
  },
  bindDateChange: function (e) {
    console.log('我是bindDateChange');
    this.setData({
      date: e.detail.value
    });
    loadSearch.search_time(e.detail.value,this,false);
  },
  bindTimeChangeTow: function (e) {
    this.setData({
      date1: e.detail.value
    })
  },inplay_material_p:function(e){
    var title = e.currentTarget.dataset.title;
    var id = e.currentTarget.dataset.id;
    if (id == 0 || id == null) {
      return;
    }

    if (this.data.clickId == id) {
      return;
    }
    this.setData({
      clickId: id
    });
    var url = '../video/video?id=' + id + '&title=' + title;
    wx.navigateTo({
      url: url,
    })
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    return {
      title: config.shareDes,
      path: '/pages/index/index',
      imageUrl: '../images/sharepic_1.jpg'
    }
  }
})
